<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			window.onload=function(){
				let arr=[145631,12.31,0.12,153,45416,48567,45,789,5364,666,745,888]
			  function bubbleSort(array){
			    /*给每个未确定的位置做循环*/
			    for(var unfix=array.length-1; unfix>0; unfix--){
			      /*给进度做个记录，比到未确定位置*/
			      for(var i=0; i<unfix;i++){
			        if(array[i]>array[i+1]){
			          var temp = array[i];
			          array.splice(i,1,array[i+1]);
			          array.splice(i+1,1,temp);
			        }
			      }
			    }
			    console.log(array)
			  }
			  bubbleSort(arr)
			}
			
		</script>
	</body>
</html>
